﻿Public Class frmDatesSelection
    Public pSelection As String

    Private Sub frmDatesSelection_Load(sender As Object, e As System.EventArgs) Handles Me.Load

        TE_DATE_DEBUT.Value = gDate_debut
        TE_DATE_FIN.Value = gDate_fin
        pSelection = ""

    End Sub

    Private Sub BO_OK_Click(sender As System.Object, e As System.EventArgs) Handles BO_OK.Click

        If DateDiff("d", TE_DATE_DEBUT.Value, TE_DATE_FIN.Value) < 0 Then
            MsgBox("Date début et la Date fin incompatible ...")
            TE_DATE_DEBUT.Focus()
        Else
            ' mémoriser les dates saisies
            gDate_debut = TE_DATE_DEBUT.Value
            gDate_fin = TE_DATE_FIN.Value
            pSelection = "du " & IfDate(TE_DATE_DEBUT.Value) & " au " & IfDate(TE_DATE_FIN.Value)
            Me.Close()
        End If

    End Sub
End Class